package handle.mvc.controller;

import handle.mvc.annotation.Autowired;
import handle.mvc.annotation.Controller;
import handle.mvc.annotation.RequestMapping;
import handle.mvc.service.ITestService;
import org.junit.Test;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Controller
@RequestMapping("/demo")
public class TestController {

    @Autowired
    private ITestService demoService;


    /**
     * URL: /demo/query?name=lisi
     *
     * @param request
     * @param response
     * @param name
     * @return
     */
    @RequestMapping("/query")
    public String query(HttpServletRequest request, HttpServletResponse response, String name) {
        return demoService.get(name);
    }
}
